package com.cblz.bd.server.core.service;

import cn.dev33.satoken.stp.SaTokenInfo;
import com.baomidou.mybatisplus.extension.service.IService;
import com.cblz.bd.common.core.entity.BaAdmin;
import com.cblz.bd.common.core.entity.system.QueryRequest;
import com.cblz.bd.common.core.exception.ValidateCodeException;
import com.cblz.bd.server.core.entity.LoginParams;
import com.cblz.bd.server.core.entity.dto.BaAdminDTO;
import com.cblz.bd.server.core.entity.vo.BaAdminManagerVO;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;
import java.util.Map;

/**
 * @author yanjieping
 * @description 针对表【ba_admin(管理员表)】的数据库操作Service
 * @createDate 2022-11-04 15:09:53
 */
public interface BaAdminService extends IService<BaAdmin> {
    /**
     * 用户名密码校验
     *
     * @param loginParams 登录对象
     * @return Token信息
     */
    SaTokenInfo usernamePasswordCheck(LoginParams loginParams) throws ValidateCodeException;

    /**
     * 注销登录
     */
    void logout();

    /**
     * 清除缓存信息
     */
    void clearCache();

    /**
     * 获取所有后台用户信息
     *
     * @return
     */
    Map<String, Object> getAllUserInfo(BaAdmin baAdmin, QueryRequest queryRequest);

    /**
     * 上传管理员头像
     *
     * @param file 图片文件
     * @return
     */
    String uploadAdminAvatar(MultipartFile file) throws Exception;

    List<BaAdminManagerVO> getUserGroupInfo(List<BaAdmin> baAdmins);

    BaAdminManagerVO getById(Integer id);

    void add(BaAdminDTO baAdmin);

    void deleteByIds(List<Integer> ids);

    void edit(BaAdminDTO baAdmin);


}
